package day0325;

public class Test4 {
    public static void main(String[] args) {
        Test4.eat(140,100);
    }

    //汽车数量，  轮胎
    //馒头steamedBread   和尚monk
    public static void eat(int streamedBread,  int monk){
        //100和尚吃140个馒头，  1个和尚吃3个馍，  1个和尚吃1个馍。
        for (int big = 0; big <=  Math.min(streamedBread/3 ,monk)   ; big++) {
            //                          monk和streamedBread比较，如果streamedBread小就采用streamedBread
            for (int small = 0; small <= (monk>streamedBread? streamedBread:monk);   small++) {
                if( (big*3 + small==streamedBread)  && (big+small==monk)){
                    System.out.println("大和尚的数量："+big+",小和尚的数量："+small);
                }
            }
        }
    }
}
